<template>
 <div>
      <custNavbar title="视频播放" uname="" paths=""></custNavbar>
    </div>
  <div>
    <video ref="myVideo" width="100%" height="210" controls>
      <source
        src="https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218093206z8V1JuPlpe.mp4"
        type="video/mp4"
      />
    </video>
  </div>
</template>
<script setup>
import { ref, computed,onMounted } from "vue";
import custNavbar from "@/components/custNavbar/index.vue";
const myVideo = ref(null);
const isPlaying = computed(() => !myVideo.paused);

onMounted(() => {
  // 获取视频标签的引用
  const videoElement = myVideo.value;
  // 播放视频
  videoElement.play();
  // 暂停视频
  videoElement.pause();

  videoElement.addEventListener("ended", () => {
    console.log("Video ended");
  });
});
</script>
<style scoped></style>
